package com.zlh123.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zlh123.commom.util.PageResult;
import com.zlh123.entity.User;
import com.zlh123.mapper.UserMapper;
import com.zlh123.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zlh
 * @since 2025-01-13
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public PageResult<User> findUsersByPage(int page, int pageSize) {
        //开始分页
        Page<User> page1=this.page(new Page<>(page, pageSize));
        //分页结果
        return new PageResult<>(page1.getRecords(),page1.getTotal());
    }
}
